//this file define TplTester interface
//andycai_sc 2011-05-15

#ifndef GTPLTESTER_H
#define GTPLTESTER_H

#include <string>
#include <map>
#include <vector>
#include <iostream>

using std::string;
using std::map;
using std::vector;
using std::cout;
using std::endl;

class GTplTester
{
public:
	virtual ~GTplTester() {}

	const string& getTestName() { return m_testName; }

	virtual void run() = 0;

protected:
	GTplTester(const string& testName) : m_testName(testName)
	{
	}
	string m_testName;
};

class GTplTestRunner
{
public:
	GTplTestRunner(int argc, char** argv);
	~GTplTestRunner();

	bool parseArgs();

	void addTester(GTplTester*);

	void runTest();

private:
	void help();
	void run(GTplTester* tester);

	map<string, GTplTester*> m_testers;
	vector<string> m_args;
	vector<GTplTester*> m_runalbeTesters;
	bool m_isAll;
	vector<string> m_unknownTests;
};

#endif
